﻿using ASmile.Com.Da;
using ASmile.DBModel;
using Microsoft.AspNetCore.Mvc;

namespace ASmile.Web.ApiControllers.SysManage
{
    [Route("api/SysManage/[controller]/[action]")]
    [ApiExplorerSettings(GroupName = "SysManage")]
    public class CfgDictController : BaseApiController<CfgDictBLL>
    {
        /// <summary>
        /// 获取字典列表
        /// {"cfgType":"配置类型"}
        /// </summary>
        [HttpPost]
        public ApiResultList<Cfg_Dict> GetCfgDicts(dynamic arg)
        {
            string cfgType = arg.cfgType;
            return BLLObj.GetCfgDicts(cfgType);
        }
        /// <summary>
        /// 获取字典类型列表
        /// </summary>
        [HttpPost]
        public ApiResultList<Cfg_DictType> GetCfgDictType()
        {
            return BLLObj.GetCfgDictType();
        }
        /// <summary>
        /// 保存配置
        /// </summary>
        [HttpPost]
        public ApiResult SaveCfgValue(Cfg_Dict model)
        {
            return BLLObj.SaveCfgValue(model);
        }
    }
}